﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CVR100AReader
{
    public static class ErrorProvider
    {
        private static Dictionary<int, string> ErrorCodeMap= new Dictionary<int, string>();

        static ErrorProvider()
        {
            ErrorCodeMap.Add(2, "寻卡失败");
            ErrorCodeMap.Add(3, "选卡失败");
            ErrorCodeMap.Add(0, "初始化失败");
        }

        public static string GetErrorDesc(int code)
        {
            if(ErrorCodeMap.ContainsKey(code))
            {
                return ErrorCodeMap[code];
            }
            else
            {
                return $"未定义错误码: {code}";
            }
        }
    }
}
